package co.yixiang.modules.statistics.dto;

import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import co.yixiang.modules.user.domain.YxUser;
import co.yixiang.utils.FileUtil;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Statistics {

    private Long uid;
    private String  username;
    private String  phone;
    //手续费
    private BigDecimal   amount;
    //佣金
    private BigDecimal brokerage;


    public static void main(String[] args) {


        List l=new ArrayList();

        List l2=new ArrayList();
        ExcelReader reader = ExcelUtil.getReader(FileUtil.file("D:\\1\\2.xlsx"));
        reader.addHeaderAlias("姓名","name");
        reader.addHeaderAlias("积分","ini");
        List<Memb> members = reader.readAll(Memb.class);

        for (Memb member : members) {
            String s= "UPDATE `yx_authentication`  a , `yx_user` u SET u.`integral`=u.`integral`+"+member.getIni()+" WHERE a.`uid` =u.`uid` and a.`real_name` =\""+member.getName()+"\";";
            System.out.println(s);
        }

        reader.close();

    }
}


